package org.hxd.utils;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117659827";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCBfkK447Om2GHc9oE2mvflbtY3n1FPFefIppD9XeYEG1ZQrD6Edp7fFDjO+kNaK8dD/gqR40u9LwtxvK/qh1QUHX6kmY16CmfyTbIbE3/RteE7Kj0H0jJIKnADAmjESCkTIaxXHAhv2aFODukdLen6iyRjjAsXEEIDl0o/YgnHlZZd0g3IY6r8JQGRNZOFiAKP+J3TnwsixyTe/D1lS/SQk9FvG73YpkGSwBjWrHDykcH7RPOQlNvPTsN9LVobewV2S7fq5jrvLlCIcdA5IXqDt0grmGUI2ufi23p2I0NHHmuN1wkfyCbOlGMXhsgEmldlxJl//FRoZjrPVvfp+2XTAgMBAAECggEAOeg3eCzDOtpKsSA+2idkseHlw8vn9WDLXOw3rEXgRXfgGoVcE6pkE0gcu1oo4lrvahVhrqmhRgGSsZL6a/uGetRRvNO585hRsYZTHk6S+znFdcrGrgeuWp03p/Dc3uGSFK8bPX0YvMPqoViDoHvWxSaR6D5I+1BW5PozxrJVwz0ZhPlFQ5xKjapD81F1BYRmU0+w4NwVFPR7vPdU8seobNWx4wECTOCtX/Ny8jMiAzoVQgPvl4mzQXJtxeaD57v+LDCgNWNwiTCmRDvcu56Uq7WkWKLVOiIjFYvr9ORZoxxzybR6cLG5eU41nnJQKi398udje+CYft+yqzCHM2wicQKBgQDW0jkbE3UjOFp75heegBwdJIkO92CjIJ3F7SpN5Vx7BN0iyN4hljc7YDOifo8gM6dCnkalEGNab/47Dc0OA+QXoNeu8kd+eHfiPRaKSrcrY1+wM4PYqkbsUmiks2jgisZnirQrgHFe/t+yGPu7SKKft9vrvUO65Ta7Pj1+MUuuSQKBgQCaUMtkKw+DP8dl+OrIqhwRPM6+MOwc/+ukex4z3BpjfDvi7EVfjSvo/ZAhxh14hbe3T5DZsM97UU5kE564VeOouo0F0VLoRge7uTMQ04sW5Ver+FT/R7lMFBznPcJtFTJVUTwJ/st9KSo22q1oiTcbavOIehIJBVQMzkvHEARjOwKBgQCRUhkLdfgx4TdkxVyI/oUGOeb11ubqs2/Hqw6JL3WGSt4FX/jUo7etVQDZFeBgmlC1wjhsBVAQp95FuKpUptEwIsCFOqSeq4P96fFLkAulME5U9iRk95uO1pivgiaab4aUGMKVAwiuiKBu7HOuWA6bGVeOe7RLxC9oL0yOB2748QKBgHUmaxIzYoZ4b88pRkxqX/5yFF3s1AM8Ak+PLCGgsePe17PxPMVKbhBmFvqc5Ziuowcl/0hUY18yHXn6Lx+wDLH2VcMZ43/0UkCgW3Uls80A9SrXzucyMyjfiAXBLA4V7m04y4SnCyKMksCsCMN4j/5fllyAl5qDkghawMpxjXMrAoGAHQEvzC/xgtFaYCloJrJWuxfPccrRfEOIkFG72HXINNcaAQgVXqbIrSjlZRUwKxnqZ6IVVapcKhYP1unV4bHrBq/eianGKYA6LLX6BT2Lt7M1/hYRGo6FKSnAp45w7V+f4UHtOzdSomFcom5+D2PbXZhMu0pDJoIxaVQktHBEe9Y=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAykoL/4pvU5tJnolNki0FEgf/4wNO8LDcmNY4IbosvI+VfnEf32575hgy8mALz8StYca8tYmy4RjHmzRKOQQW+5TNPu5gFSqSXmYGY7bIyAAZyvGXuKJutwSuH2XuM6S/KaA9NY9BfoHXYshv8G1OpC1HfG/imJ376SrIjPGDePKJfI8hhFe1xcBSZV2bxOXDFBIibsNtWhWaO10yYpIeUuq4AE/kwkVHnNl4wR+tgAoMwYJEn39kDsfaLPOY9dCAJFJbTeABq/46UQmF62aJpIzc4PqZfrYAT+VX7zM91+XaoPw1GvxdkIrJ5qs6iiYzsyjSykb40qv4WATpuOu01wIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/bookstore/client/order/paysuccess";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

